<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title id="title">蒟蒻云内测|</title>
	<link rel="stylesheet" type="text/css" href="../blog/default_markdown.css">	 
	<link rel="icon" href="http://dev.juruoyun.top/data/general/picture/logo.ico" type="image/x-icon">
	<link rel="shortcut icon" href="http://dev.juruoyun.top/data/general/picture/logo.ico" type="image/x-icon">
	<link rel="stylesheet" type="text/css" href="../css/default_general.css">
	<link rel="stylesheet" type="text/css" href="../font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="../css/default_desktop.css">
	<link rel="stylesheet" type="text/css" href="../css/colorpicker.css">
	<meta name="description" content="由李俊彦自己开发的个人站，所有代码都是我自己写的 ">
	<meta name="robots" content="noarchive">
	<script language="javascript" src="../js/all_js.js"></script>
	<script language="javascript" src="../js/md5.js"></script>
	<script language="javascript" src="../js/colorpicker.js"></script>
	<script language="javascript" src="../blog/markdown.js"></script>
</head>
<body style="height:500%">
<div id="body" style="width:100%;height:100%;"></div>
<style>
.jry_wb_window_body
{
	background-color:#5f5f5f;
	border-radius:10px;
	box-shadow:10px 9px 18px #6666;	
}
.jry_wb_window_body .jry_wb_window_top
{
	border-top-left-radius:10px;
	border-top-right-radius:10px;
	background-color:#66ccff;
	width:100%;
	position:absolute;
	top:0px;
	left:0px;
	height:25px;
	text-align:center;
	font-size:20px;
	color:#ffffff;
}
</style>
<script>
	function jry_wb_windows(area)
	{
		this.list=[];
		this.area=area;
		this.now_position={'x':0,'y':0};
		jry_wb_add_onmousemove((e)=>
		{
			if(!e)
				e=window.event;		
			if(this.buf!=null)
				this.buf.run(e);
		});
		jry_wb_add_onmouseup(()=>
		{
			if(this.buf!=null)
				this.buf.body.onmouseup();
		});
		jry_wb_add_onscroll((e)=>
		{
			if(!e)
				e=window.event;		
			if(this.buf!=null)
				this.buf.run(e);	
		});
	}
	jry_wb_windows.prototype.add=function(name)
	{
		
		function jry_wb_window(area,name,this_,x,y)
		{
			this.body=document.createElement('div');area.appendChild(this.body);
			this.body.classList.add('jry_wb_window_body');
			this.body.style.width="500px";this.body.style.height="400px";this.body.style.position="absolute";
			this.setposition(x,y);
			this.flag=false;
			this.top=document.createElement('div');this.body.appendChild(this.top);
			this.top.classList.add('jry_wb_window_top');
			this.top.innerHTML=name;
			this.body.onmousedown=(e)=>
			{
				this_.fresh(this);
				if(!e)
					e=window.event;
				var scrollTop = document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;
				var scrollLeft = document.body.scrollLeft==0?document.documentElement.scrollLeft:document.body.scrollLeft;
				this.start={'x':parseInt(this.body.style.left)-e.clientX-scrollLeft,'y':parseInt(this.body.style.top)-e.clientY-scrollTop}
				this.last={'x':e.clientX,'y':e.clientY};
			};
			this.body.onmouseup=()=>
			{
				this.flag=false;
				this_.buf=null;
			};
			this.body.onmousemove=(e)=>
			{
				if(!this.flag)
					return;
				if(!e)
					e=window.event;
				this.last={'x':e.clientX,'y':e.clientY};
				this.run(e);
			};
			this.body.onscroll=(e)=>
			{
				if(!this.flag)
					return;
				if(!e)
					e=window.event;
				this.run(e);
			};		
		}
		jry_wb_window.prototype.setposition=function(x,y)
		{
			this.body.style.top=x;this.body.style.left=y;
		};
		jry_wb_window.prototype.run=function(e)
		{
			if(e.clientX==undefined)
				e.clientX=this.last.x;e.clientY=this.last.y;
			var scrollTop = document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;
			var scrollLeft = document.body.scrollLeft==0?document.documentElement.scrollLeft:document.body.scrollLeft;
			this.setposition(e.clientY+scrollTop+this.start.y,e.clientX+scrollLeft+this.start.x);
		};
		this.list[this.list.length]=new jry_wb_window(this.area,name,this,this.now_position.x+=50,this.now_position.y+=50);
		this.fresh(this.list[this.list.length-1]);this.list[this.list.length-1].flag=false;
		this.buf=null;
		return this.list[this.list.length-1];
	};
	jry_wb_windows.prototype.fresh=function(one)
	{
		if(this.last!=null)
			this.last.flag=false;
		this.last=this.buf=one;
		one.flag=true;
		for(var i=0,n=this.list.length;i<n;i++)
			if(this.list[i]==one)
				this.list[i].body.style.zIndex=500;
			else
				this.list[i].body.style.zIndex--;
	};
	jry_wb_windows.prototype.delete=function(one)
	{
		for(var i=0,n=this.list.length;i<n;i++)
			if(this.list[i]==one)
			{
				this.area.removeChild(one.body)
				windows.list.splice(i,1)
			}
	}
var windows=new jry_wb_windows(document.getElementById('body'));
var one=windows.add('Test1');
var two=windows.add('Test2');
var three=windows.add('Test3');
var four=windows.add('Test4');
</script>
</body>